package com.rui.cn.feignservice;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.baomidou.mybatisplus.service.IService;
import com.rui.cn.consumer.common.FeignClientConfig;
import com.rui.cn.entity.system.SysPermission;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author zhang123
 * @since 2018-01-15
 */
@FeignClient(value="CLOUD-ZUUL-GATEWAY",configuration=FeignClientConfig.class)
public interface SysPermissionService{
    @GetMapping(value = "/cloud/permission-proxy/syspermis/loadUserPermission/{id}")
    List<SysPermission> loadUserPermission(@PathVariable("id") Integer id);

    @PostMapping(value = "/cloud/permission-proxy/syspermis/permissionList")
    List<SysPermission> permissionList(@RequestBody Pagination pagination,@RequestParam(required =false,value = "search") String search,@RequestParam(required =false,value = "sortBy") String sortBy,@RequestParam(required =false,value = "order") String order);

    @GetMapping(value = "/cloud/permission-proxy/syspermis/getRolePermiss/{roleid}")
    List<SysPermission> getRolePermiss(@PathVariable("roleid") Integer roleid);

    @GetMapping(value = "/cloud/permission-proxy/syspermis/getPermissionInfo/{id}")
    SysPermission getPermissionInfo(@PathVariable("id") Integer id);

    @PostMapping(value = "/cloud/permission-proxy/syspermis/selectList")
    List<SysPermission> selectList();

    @PostMapping(value = "/cloud/permission-proxy/syspermis/insertOrUpdate")
    boolean insertOrUpdate(@RequestBody SysPermission permission);

    @DeleteMapping(value = "/cloud/permission-proxy/syspermis/deleteBatchIds")
    boolean deleteBatchIds(@RequestBody List<Integer> integers);

    @GetMapping(value = "/cloud/permission-proxy/syspermis/selectById/{id}")
    SysPermission selectById(@PathVariable("id") Integer id);

    @GetMapping(value = "/cloud/permission-proxy/syspermis/selectByIdOrParentId/{id}")
    List<SysPermission> selectByIdOrParentId(@PathVariable("id") String id);

    @GetMapping(value = "/cloud/permission-proxy/syspermis/selectByParentId/{parentid}")
    List<SysPermission> selectByParentId(@PathVariable("parentid") Integer parentid);
}
